<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品详情 - 阿里宝宝</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/components.css">
    <link rel="stylesheet" href="css/responsive.css">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
</head>
<body>
    <!-- 顶部导航栏 -->
    <header class="header">
        <div class="container">
            <div class="header-content">
                <!-- Logo -->
                <div class="logo">
                    <a href="index.html">
                        <i class="fas fa-shopping-bag"></i>
                        <span>阿里宝宝</span>
                    </a>
                </div>

                <!-- 搜索框 -->
                <div class="search-box">
                    <input type="text" id="searchInput" placeholder="搜索商品...">
                    <button id="searchBtn"><i class="fas fa-search"></i></button>
                </div>

                <!-- 用户操作区 -->
                <div class="user-actions">
                    <div class="user-menu" id="userMenu">
                        <button class="user-btn" id="userBtn">
                            <i class="fas fa-user"></i>
                            <span id="userName">登录</span>
                        </button>
                        <div class="user-dropdown" id="userDropdown">
                            <div class="dropdown-content">
                                <a href="#" id="loginLink">登录</a>
                                <a href="#" id="registerLink">注册</a>
                                <a href="#" id="profileLink" style="display: none;">个人中心</a>
                                <a href="#" id="ordersLink" style="display: none;">我的订单</a>
                                <a href="#" id="logoutLink" style="display: none;">退出登录</a>
                            </div>
                        </div>
                    </div>
                    
                    <div class="cart-icon" id="cartIcon">
                        <a href="cart.html">
                            <i class="fas fa-shopping-cart"></i>
                            <span class="cart-count" id="cartCount">0</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- 面包屑导航 -->
    <nav class="breadcrumb">
        <div class="container">
            <ol class="breadcrumb-list">
                <li><a href="index.html">首页</a></li>
                <li><a href="#" id="categoryLink">商品分类</a></li>
                <li id="currentProduct">商品详情</li>
            </ol>
        </div>
    </nav>

    <!-- 商品详情主要内容 -->
    <main class="product-detail-main">
        <div class="container">
            <div class="product-detail-content">
                <!-- 商品图片区域 -->
                <div class="product-images">
                    <div class="main-image">
                        <img id="mainProductImage" src="" alt="商品主图">
                        <div class="image-zoom" id="imageZoom"></div>
                    </div>
                    <div class="thumbnail-images" id="thumbnailImages">
                        <!-- 缩略图将通过JavaScript动态生成 -->
                    </div>
                </div>

                <!-- 商品信息区域 -->
                <div class="product-info">
                    <h1 class="product-title" id="productTitle">商品名称</h1>
                    
                    <div class="product-price-section">
                        <div class="current-price">
                            <span class="price-label">价格：</span>
                            <span class="price-value" id="productPrice">¥0.00</span>
                        </div>
                        <div class="original-price" id="originalPrice" style="display: none;">
                            <span class="price-label">原价：</span>
                            <span class="price-value">¥0.00</span>
                        </div>
                        <div class="discount-badge" id="discountBadge" style="display: none;">
                            <span id="discountPercent">0%</span>
                        </div>
                    </div>

                    <div class="product-meta">
                        <div class="meta-item">
                            <span class="meta-label">商品ID：</span>
                            <span class="meta-value" id="productId">-</span>
                        </div>
                        <div class="meta-item">
                            <span class="meta-label">产地：</span>
                            <span class="meta-value" id="productLocation">-</span>
                        </div>
                        <div class="meta-item">
                            <span class="meta-label">分类：</span>
                            <span class="meta-value" id="productCategory">-</span>
                        </div>
                        <div class="meta-item">
                            <span class="meta-label">商家：</span>
                            <span class="meta-value" id="productMerchant">-</span>
                        </div>
                    </div>

                    <div class="product-description">
                        <h3>商品描述</h3>
                        <p id="productDescription">商品详细描述信息...</p>
                    </div>

                    <!-- 购买操作区域 -->
                    <div class="purchase-section">
                        <div class="quantity-selector">
                            <label for="quantity">数量：</label>
                            <div class="quantity-controls">
                                <button class="quantity-btn" id="decreaseQuantity">-</button>
                                <input type="number" id="quantity" value="1" min="1" max="99">
                                <button class="quantity-btn" id="increaseQuantity">+</button>
                            </div>
                        </div>

                        <div class="purchase-buttons">
                            <button class="btn btn-primary add-to-cart-detail" id="addToCartBtn">
                                <i class="fas fa-shopping-cart"></i>
                                加入购物车
                            </button>
                            <button class="btn btn-success buy-now" id="buyNowBtn">
                                <i class="fas fa-bolt"></i>
                                立即购买
                            </button>
                            <button class="btn btn-outline play-game" id="playGameBtn">
                                <i class="fas fa-gamepad"></i>
                                玩折扣游戏
                            </button>
                        </div>
                    </div>

                    <!-- 服务保障 -->
                    <div class="service-guarantee">
                        <h3>服务保障</h3>
                        <div class="guarantee-items">
                            <div class="guarantee-item">
                                <i class="fas fa-shield-alt"></i>
                                <span>正品保证</span>
                            </div>
                            <div class="guarantee-item">
                                <i class="fas fa-truck"></i>
                                <span>快速配送</span>
                            </div>
                            <div class="guarantee-item">
                                <i class="fas fa-undo"></i>
                                <span>7天退换</span>
                            </div>
                            <div class="guarantee-item">
                                <i class="fas fa-headset"></i>
                                <span>客服支持</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 商品详情标签页 -->
            <div class="product-tabs">
                <div class="tab-nav">
                    <button class="tab-btn active" data-tab="details">商品详情</button>
                    <button class="tab-btn" data-tab="reviews">用户评价</button>
                    <button class="tab-btn" data-tab="logistics">物流信息</button>
                </div>

                <div class="tab-content">
                    <!-- 商品详情标签页 -->
                    <div class="tab-panel active" id="detailsTab">
                        <div class="product-specifications">
                            <h3>商品规格</h3>
                            <table class="spec-table">
                                <tbody id="specTableBody">
                                    <!-- 规格信息将通过JavaScript动态生成 -->
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <!-- 用户评价标签页 -->
                    <div class="tab-panel" id="reviewsTab">
                        <div class="reviews-section">
                            <div class="reviews-summary">
                                <div class="rating-overview">
                                    <div class="rating-score">
                                        <span class="score" id="averageRating">4.5</span>
                                        <div class="stars" id="ratingStars">
                                            <!-- 星级评分将通过JavaScript生成 -->
                                        </div>
                                    </div>
                                    <div class="rating-breakdown" id="ratingBreakdown">
                                        <!-- 评分分布将通过JavaScript生成 -->
                                    </div>
                                </div>
                            </div>

                            <div class="reviews-filters">
                                <div class="filter-group">
                                    <label>筛选：</label>
                                    <select id="reviewFilter">
                                        <option value="all">全部评价</option>
                                        <option value="5">5星</option>
                                        <option value="4">4星</option>
                                        <option value="3">3星</option>
                                        <option value="2">2星</option>
                                        <option value="1">1星</option>
                                    </select>
                                </div>
                                <div class="filter-group">
                                    <label>排序：</label>
                                    <select id="reviewSort">
                                        <option value="latest">最新</option>
                                        <option value="helpful">最有用</option>
                                        <option value="rating">评分</option>
                                    </select>
                                </div>
                            </div>

                            <div class="reviews-list" id="reviewsList">
                                <!-- 评价列表将通过JavaScript动态生成 -->
                            </div>

                            <div class="load-more-reviews">
                                <button class="btn btn-outline" id="loadMoreReviews">加载更多评价</button>
                            </div>
                        </div>
                    </div>

                    <!-- 物流信息标签页 -->
                    <div class="tab-panel" id="logisticsTab">
                        <div class="logistics-section">
                            <div class="logistics-info">
                                <h3>配送信息</h3>
                                <div class="logistics-details">
                                    <div class="logistics-item">
                                        <i class="fas fa-map-marker-alt"></i>
                                        <span>发货地：<span id="originLocation">-</span></span>
                                    </div>
                                    <div class="logistics-item">
                                        <i class="fas fa-truck"></i>
                                        <span>配送方式：快递配送</span>
                                    </div>
                                    <div class="logistics-item">
                                        <i class="fas fa-clock"></i>
                                        <span>预计送达：<span id="estimatedDelivery">-</span></span>
                                    </div>
                                    <div class="logistics-item">
                                        <i class="fas fa-dollar-sign"></i>
                                        <span>运费：<span id="shippingFee">-</span></span>
                                    </div>
                                </div>
                            </div>

                            <div class="logistics-map" id="logisticsMap">
                                <h3>配送路线</h3>
                                <div class="map-placeholder">
                                    <i class="fas fa-map"></i>
                                    <p>地图加载中...</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 推荐商品 -->
            <div class="recommended-products">
                <h2 class="section-title">相关推荐</h2>
                <div class="products-grid" id="recommendedProducts">
                    <!-- 推荐商品将通过JavaScript动态加载 -->
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <div class="footer-content">
                <div class="footer-section">
                    <h3>关于我们</h3>
                    <p>阿里宝宝致力于为用户提供优质的购物体验</p>
                </div>
                <div class="footer-section">
                    <h3>客户服务</h3>
                    <ul>
                        <li><a href="#">帮助中心</a></li>
                        <li><a href="#">联系客服</a></li>
                        <li><a href="#">意见反馈</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>购物指南</h3>
                    <ul>
                        <li><a href="#">购物流程</a></li>
                        <li><a href="#">配送说明</a></li>
                        <li><a href="#">退换货政策</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>关注我们</h3>
                    <div class="social-links">
                        <a href="#"><i class="fab fa-weixin"></i></a>
                        <a href="#"><i class="fab fa-weibo"></i></a>
                        <a href="#"><i class="fab fa-qq"></i></a>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <p>&copy; 2024 阿里宝宝电商平台. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <!-- 图片放大模态框 -->
    <div class="modal" id="imageModal">
        <div class="modal-content image-modal">
            <span class="close" id="closeImageModal">&times;</span>
            <img id="modalImage" src="" alt="商品图片">
        </div>
    </div>

    <!-- 评价模态框 -->
    <div class="modal" id="reviewModal">
        <div class="modal-content">
            <div class="modal-header">
                <h2>添加评价</h2>
                <span class="close" id="closeReviewModal">&times;</span>
            </div>
            <div class="modal-body">
                <form id="reviewForm">
                    <div class="form-group">
                        <label>商品评分：</label>
                        <div class="rating-input" id="productRating">
                            <i class="fas fa-star" data-rating="1"></i>
                            <i class="fas fa-star" data-rating="2"></i>
                            <i class="fas fa-star" data-rating="3"></i>
                            <i class="fas fa-star" data-rating="4"></i>
                            <i class="fas fa-star" data-rating="5"></i>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>商家评分：</label>
                        <div class="rating-input" id="merchantRating">
                            <i class="fas fa-star" data-rating="1"></i>
                            <i class="fas fa-star" data-rating="2"></i>
                            <i class="fas fa-star" data-rating="3"></i>
                            <i class="fas fa-star" data-rating="4"></i>
                            <i class="fas fa-star" data-rating="5"></i>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>物流评分：</label>
                        <div class="rating-input" id="logisticsRating">
                            <i class="fas fa-star" data-rating="1"></i>
                            <i class="fas fa-star" data-rating="2"></i>
                            <i class="fas fa-star" data-rating="3"></i>
                            <i class="fas fa-star" data-rating="4"></i>
                            <i class="fas fa-star" data-rating="5"></i>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="reviewText">评价内容：</label>
                        <textarea id="reviewText" name="reviewText" rows="5" placeholder="请分享您的购物体验..."></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary">提交评价</button>
                </form>
            </div>
        </div>
    </div>

    <!-- 加载提示 -->
    <div class="loading" id="loading">
        <div class="loading-spinner"></div>
        <p>加载中...</p>
    </div>

    <!-- 登录/注册模态框 -->
    <div class="modal" id="authModal">
        <div class="modal-content">
            <div class="modal-header">
                <h2 id="modalTitle">用户登录</h2>
                <span class="close" id="closeModal">&times;</span>
            </div>
            <div class="modal-body">
                <form id="authForm">
                    <div class="form-group">
                        <label for="username">用户名</label>
                        <input type="text" id="username" name="username" required>
                    </div>
                    <div class="form-group">
                        <label for="password">密码</label>
                        <input type="password" id="password" name="password" required>
                    </div>
                    <div class="form-group" id="emailGroup" style="display: none;">
                        <label for="email">邮箱</label>
                        <input type="email" id="email" name="email">
                    </div>
                    <div class="form-group" id="phoneGroup" style="display: none;">
                        <label for="phone">手机号</label>
                        <input type="tel" id="phone" name="phone">
                    </div>
                    <div class="form-group" id="shopNameGroup" style="display: none;">
                        <label for="shopName">店铺名称</label>
                        <input type="text" id="shopName" name="shopName">
                    </div>
                    <div class="form-group" id="userTypeGroup" style="display: none;">
                        <label for="userType">用户类型</label>
                        <select id="userType" name="userType">
                            <option value="Customer">买家</option>
                            <option value="Seller">卖家</option>
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary" id="submitBtn">登录</button>
                </form>
                <div class="auth-switch">
                    <p id="switchText">还没有账号？<a href="#" id="switchLink">立即注册</a></p>
                </div>
            </div>
        </div>
    </div>

    <!-- 通知提示 -->
    <div class="notification" id="notification">
        <div class="notification-content">
            <i class="fas fa-check-circle"></i>
            <span id="notificationText">操作成功</span>
        </div>
    </div>

    <!-- JavaScript文件 -->
    <script src="js/api.js"></script>
    <script src="js/auth.js"></script>
    <script src="js/cart.js"></script>
    <script src="js/product.js"></script>
    <script src="js/game.js"></script>
    <script src="js/product-detail.js"></script>
</body>
</html>
